/**
 * Wihidum - Efficient Broker Hierarchy for Publish Subscribe Middleware
 *
 * License      :   Apache License 2.0
 * Home Page    :   http://code.google.com/p/wihidum/
 * Mailing List :   wihidum@googlegroups.com
 */

package lk.mrt.cse.wihidum.storage;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import java.util.Set;

/**
 * Represents broker object
 */
@Entity
public class Broker {

    private String id;
    private String address;
    private String role;
    private Set<Broker> superUnits;
    private Set<Broker> peerUnits;
    private Set<Broker> subUnits;

    @Id
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    @OneToMany
    public Set<Broker> getSuperUnits() {
        return superUnits;
    }

    public void setSuperUnits(Set<Broker> superUnits) {
        this.superUnits = superUnits;
    }

    @OneToMany
    public Set<Broker> getSubUnits() {
        return subUnits;
    }

    public void setSubUnits(Set<Broker> subUnits) {
        this.subUnits = subUnits;
    }

    @OneToMany
    public Set<Broker> getPeerUnits() {
        return peerUnits;
    }

    public void setPeerUnits(Set<Broker> peerUnits) {
        this.peerUnits = peerUnits;
    }
}
